-
Notifications
You must be signed in to change notification settings - Fork 734
refactor(dev): remove errorName from Error classes #5769
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
0e93a97 to
124dc72
Compare
| ) | ||
| }) | ||
|
|
||
| it('should handle default errors', async function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Each of these tests is near-identical. Part of the job of developing this project is to look for ways to reduce duplicate code and increase maintainability. Hundreds of lines of duplicate code is unacceptable. Please keep this in mind for future contributions.
justinmk3
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
latest push has lots of duplicate code
124dc72 to
483e717
Compare
| } | ||
|
|
||
| runs.forEach((run) => { | ||
| it(`should handle ${run.name}`, async function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For reference this is one way of de-duplicating tests, but it would also be fine to have a bunch of manally-declared it() blocks which call a common function.
|
Thank you for this clean up! |
## Problem - Static `errorName` is unnecessary in feature dev error classes. It also causes error code mismatches some of errorName which result in wrong state. ## Solution - Remove `errorName` from error classes - use class name match to ensure error handled correctly. - Add unit tests to cover all the error cases.
Problem
errorNameis unnecessary in feature dev error classes. It also causes error code mismatches some of errorName which result in wrong state.Solution
errorNamefrom error classesLicense: I confirm that my contribution is made under the terms of the Apache 2.0 license.